﻿using EnvDTE;

namespace TskComment.Infra
{
    public abstract class BaseComment:IComment
    {
        public abstract string Title{get;}

        public abstract string Description{get;}

        public abstract void Execute(DTE dte);

        public override string ToString()
        {
            return Title;
        }

        protected TextSelection Selection(DTE dte)
        {
            return dte.ActiveDocument.Selection;
        }

        protected CodeFunction Function(DTE dte)
        {
            return Selection(dte).ActivePoint.CodeElement[vsCMElement.vsCMElementFunction] as CodeFunction;
        }
    }
}
